package com.itheima;

import com.itheima.autoconfig.aip.AipFaceProperties;
import com.itheima.autoconfig.aip.AipFaceTemplate;
import com.itheima.autoconfig.green.AliyunGreenProperties;
import com.itheima.autoconfig.green.AliyunGreenTemplate;
import com.itheima.autoconfig.im.HuanXinProperties;
import com.itheima.autoconfig.im.HuanXinTemplate;
import com.itheima.autoconfig.oss.OssProperties;
import com.itheima.autoconfig.oss.OssTemplate;
import com.itheima.autoconfig.sms.SmsProperties;
import com.itheima.autoconfig.sms.SmsTemplate;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(
        {
                SmsProperties.class, //短信访问用到的配置类
                OssProperties.class, //oss访问用到的配置类
                AipFaceProperties.class, //百度ai人脸检测用到的配置类
                HuanXinProperties.class,//环信im用的配置类
                AliyunGreenProperties.class//内容审核用的配置类
        }
)
public class TanhuaAutoConfiguration {

    @Bean
    public SmsTemplate smsTemplate(SmsProperties smsProperties){
        return new SmsTemplate(smsProperties);
    }

    @Bean
    public OssTemplate ossTemplate(OssProperties ossProperties){
        return new OssTemplate(ossProperties);
    }

    @Bean
    public AipFaceTemplate aipFaceTemplate(AipFaceProperties aipFaceProperties){
        return new AipFaceTemplate(aipFaceProperties);
    }

    @Bean
    public HuanXinTemplate huanXinTemplate(HuanXinProperties huanXinProperties){
        return new HuanXinTemplate(huanXinProperties);
    }

    @Bean
    public AliyunGreenTemplate aliyunGreenTemplate(AliyunGreenProperties aliyunGreenProperties){
        return new AliyunGreenTemplate(aliyunGreenProperties);
    }
}
